package serach;

public class BM19 {
    public static int findPeakElement (int[] nums) {
        // write code here
        int start = 0 ;
        int end = nums.length-1;
        while (start<=end)
        {
            int mid = (start+end)/2;
            if(start==end)
            {
                break;
            }
            if(nums[mid]>nums[mid+1])
            {
                end = mid;
            }else
                start = mid+1;

        }
        return end;
    }

    public static void main(String[] args) {
        int []num = {2};
        findPeakElement(num);
    }
}
